<#if category=="java">
	<#assign docname = "javadoc">
</#if>

<header>
	<div class="container">
		<h1>${project.name}</h1>
		<p>${project.description}</p>
		<p id="tags"><#list project.tags as tag><span class="badge">${tag}</span></#list></p>
	</div>
</header>
<div class="container" id="menu">
	<ul class="list-inline">
		<li><span class="glyphicon glyphicon-home"></span> <a href="${project.home}" target="_blank" class="home">项目主页</a></li>
	</ul>
</div>
<div class="container" id="body">
	<ol class="breadcrumb">
	  <li><a href="javascript:void(0)">docgit</a></li>
	  <li><a href="${path('/archieve/',category)}">${category}</a></li>
	  <li class="active">${project.name}</li>
	</ol>
	<#if subprojects?size gt 1>
		<div>
			<div class="dropdown">
				<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">
					sub-projects (${subprojects?size})
					<span class="caret"></span>
				</button>
				<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
					<#list subprojects as p>
						<li><a href="#${p}">${p}</a></li>
					</#list>
				</ul>
			</div>
		</div>
	</#if>
	<#list majorsList as majors>
		<#if majorsList?size gt 1>
		<h1 class="title-major" id="${majors.name}">
			<span class="glyphicon glyphicon-align-justify"></span> ${majors.name}
		</h1>
		</#if>
		<#if majors.latest??>
			<h4>Latest</h4>
			<table class="table table-bordered">
				<tr><td data-target="_blank" data-url="${majors.latest}"><span class="glyphicon glyphicon-file"></span> ${docname}</td></tr>
			</table>
		</#if>
		<#list majors.majors as major>
			<hr/>
			<h4>${major.name}.x</h4>
			<table class="table table-bordered table-version">
			<#if major.document??>
				<tr>
					<td 
						data-target="_blank" 
						data-url="${major.document}"
						colspan="3"
					>
						<span class="glyphicon glyphicon-file"></span> ${docname}
					</td>
				</tr>
			</#if>
			<#list major.versions as version>
				<tr>
					<th>${version.name}</th>
					<#if version.documents?size == 1>
						<td 
							data-target="_blank" 
							data-url="${version.documents[0]}"
							data-title="true"
						>
							<span class="glyphicon glyphicon-file"></span> ${docname}
						</td>
					<#elseif version.documents?size gt 0>
						<td>
							<#list version.documents as document>
							<div
								data-target="_blank" 
								data-url="${document}"
							data-title="true"
							>
								<span class="glyphicon glyphicon-file"></span> ${docname}
							</div>
							</#list>
						</td>
					<#else>
						<td	class="no-link">
							<span class="glyphicon glyphicon-file"></span> ${docname}
						</td>
					</#if>
					<#if version.artifacts?size == 1>
						<td class="artifacts"
							data-target="_blank" 
							data-url="${version.artifacts[0].url}"
							data-title="true"
						>
							<span class="glyphicon glyphicon-download-alt"></span> ${version.artifacts[0].name}
						</td>
					<#else>
					<td class="artifacts">
						<#list version.artifacts as artifact>
						<div 
							data-target="_blank" 
							data-url="${artifact.url}"
							data-title="true"
						>
							<span class="glyphicon glyphicon-download-alt"></span> ${artifact.name}
						</div>
						</#list>
					</td>
					</#if>
				</tr>
			</#list>
			</table>
			<#if major.mavens?size gt 0>
				<#list major.mavens as maven>
				<div>
					<a target="_blank" href="http://mvnrepository.com/artifact/${maven.groupId}/${maven.artifactId}" title="${maven.repository}">
						<span class="maven">Maven</span><span class="maven-artifact">${maven.artifactId}</span>
					</a>
				</div>
				<pre class="maven-code">&lt;dependency&gt;
    &lt;groupId&gt;${maven.groupId}&lt;/groupId&gt;
    &lt;artifactId&gt;${maven.artifactId}&lt;/artifactId&gt;
    &lt;version&gt;${major.versions[0].name}&lt;/version&gt;
&lt;/dependency&gt;</pre>
				</#list>
			</#if>
		</#list>
	</#list>
	<#list bodies as body>
		<div class="appender">
			${body}
		</div>
	</#list>
</div>